<{include file="Toy/toy_top.html"}>
    </head>
    <body>
    	<div id="wrap" class="detailPage">
			<{include file="Toy/toy_nav.html"}>
    		<div id="pos" style=" position: fixed;
    right: 15px;
    min-width: 2rem;
    background: rgba(0, 0, 0, 0.5);
    display: block;
    z-index: 99;
    color: white;
    font-size: 0.3rem;
    height: 1rem;
    border-bottom-right-radius: 0.2rem;
    border-bottom-left-radius: 0.2rem;padding:0.1rem">
				<{$obj.position}><br />
				价值：<{$obj.value}>元
			</div>
    		<div class="container">
    			<div class="swiper-container">
				    <div class="swiper-wrapper">
						<{foreach from=$album item=item key=key}>

				        <div class="swiper-slide" style="background: url(<{$item}>) no-repeat;">

							<{if $canExchange eq 1}>
								<div class="des">
									<div class="textDesc">
										<span class="intro" >(<{$key+1}>/<{$albumSize}>) <{$obj.desc}></span>
										<span class="intent" ><{$obj.intention}></span>
									</div>
									<a href="javascript:void(0)" onclick="apply()" class="exchange">申请兑换</a>
								</div>
							<{else}>
								<div class="des">
									<div class="name">(<{$key+1}>/<{$albumSize}>) <{$obj.desc}></div>
									<p><{$obj.intention}></p>
								</div>
							<{/if}>


				        </div>
						<{/foreach}>
				    </div>
				    <div class="swiper-pagination"></div>
				</div>
    		</div>
    	</div>
    	<script src="<{$preStaticUrl}>Wap/toy/js/zepto.min.js"></script>
    	<script src="<{$preStaticUrl}>Wap/toy/js/swiper-3.3.1.min.js"></script>
    	<script src="<{$preStaticUrl}>Wap/toy/js/index.js"></script>
    	<script>
    		$(function(){
    			var mySwiper = new Swiper ('.swiper-container', {
				    loop: true,
				    pagination: '.swiper-pagination'
			  	})
    		});

			function apply(){
				if(<{$haveExchange}>){
						location.href="<{u('apply?id='|cat:$obj.id)}>";
				}else{
					//询问框
					layer.open({
						content: '您目前没有可用于交换的宝贝，现在就去上架吗？'
						,btn: ['前往','取消' ]
						,yes: function(index){
							location.href="<{u('publish')}>";
							layer.close(index);
						}
					});
						}
			}
    	</script>
	</body>
</html>
